﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WarehouseManagement.DataAccess;

namespace WarehouseManagement.BusinessLogic.DTO
{
    public class SupplierDTO
    {
        public int Id { get; set; }
        public string SupplierName { get; set; }
        public string Address { get; set; }
        public string MobilePhone { get; set; }
        public string BankAccount { get; set; }
        public string BankName { get; set; }
        public string Email { get; set; }


    }

    public static class SupplierDTOExtensions
    {
        public static Supplier ToEntity(this SupplierDTO dto)
        {
            return new Supplier()
            {
                Id = dto.Id,
                SupplierName = dto.SupplierName,
                Address = dto.Address,
                BankAccount = dto.BankAccount,
                BankName = dto.BankName,
                Email = dto.Email,
                MobilePhone = dto.MobilePhone
            };
        }

        public static SupplierDTO ToEntity(this Supplier entity)
        {
            return new SupplierDTO()
            {
                Id = entity.Id,
                SupplierName = entity.SupplierName,
                Address = entity.Address,
                BankAccount = entity.BankAccount,
                BankName = entity.BankName,
                Email = entity.Email,
                MobilePhone = entity.MobilePhone
            };
        }
    }
}
